package Text2;

import javax.swing.plaf.SliderUI;

/*
 *@Student 张策
 */
public class n01 {
    public static void main(String[] args) throws InterruptedException {
        Dog dog = new Dog();
        Thread thread=new Thread(dog);//代理模式
        thread.start();
        for (int i = 0; i < 10; i++) {
            System.out.println("住西安测绘给你"+1);
            Thread.sleep(600);
        }
    }
}
class Dog implements Runnable{
int num=0;
    @Override
    public void run() {
        while (true) {
            System.out.println("zc"+(++num)+Thread.currentThread().getName());
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            if(num==10){
                break;
            }
        }
    }
}
